<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:pe="http://primefaces.org/ui/extensions">

<h:head>
	<title>Welcome to JSF_PrimeFaces_Spring_Hibernate Project</title>
</h:head>
<body>
	
	
	<h:form>
	<p:layout style="min-width:700px;min-height:1200px;" id="layout">  
    <p:layoutUnit position="west" resizable="true" size="240" minSize="240" maxSize="400">  
    
      <p:menu>  
        
        <p:submenu label="Ajax Menuitems">  
            <p:menuitem value="Save" update="@form"  actionListener="#{contribuyente.insertContribuyentes}"  icon="ui-icon-disk" />  
            <p:menuitem value="Update"  icon="ui-icon-arrowrefresh-1-w"/>  
        </p:submenu>  
        <p:submenu label="Non-Ajax Menuitem">  
            <p:menuitem value="Delete"  ajax="false" icon="ui-icon-close"/>  
        </p:submenu>  
        <p:submenu label="Navigations">  
            <p:menuitem value="External" url="http://www.primefaces.org" icon="ui-icon-home"/>  
             
        </p:submenu>  
    </p:menu> 

    </p:layoutUnit>  
  
    <p:layoutUnit position="center">  


		<p:panel id="pnl2" header="Ingreso Contribuyentes"  toggleable="true" closable="true" toggleSpeed="500" closeSpeed="500" >
			<p:panelGrid columns="4" cellpadding="8" >
			
				<h:outputText value="Registro Proveedor: " />
				<p:inputMask value="#{contribuyente.regProv}" mask="a*-999" />

				<h:outputText value="Nombre Proveedor: " />
				<p:inputText value="#{contribuyente.nomProv}" />

				<h:outputText value="Razon Social: " />
				<p:inputText value="#{contribuyente.razonSoc}" />

				<h:outputText value="Representante Legal: " />
				<p:inputText value="#{contribuyente.repLegal}" />

				<h:outputText value="Contacto: " />
				<p:inputMask value="#{ contribuyente.contacto}" mask="9999-9999" />


		<h:outputText value="Correo Electronico: " />
				<p:inputText id="text2" value="#{contribuyente.correoe}" style="margin-bottom: 10px; "
					requiredMessage="Please enter your email address."
					validatorMessage="Invalid email format">
					<f:validateRegex
						pattern="^[_A-Za-z0-9-\+]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9]+)*(\.[A-Za-z]{2,})$" />
				</p:inputText>
				
				<h:outputText value="Direccion 1: " />
				<p:inputTextarea value="#{contribuyente.direccion1}" rows="6"
					cols="33" />
				
			

				<h:outputText value="Direccion 2: " />
				<p:inputTextarea value="#{contribuyente.direccion2}" rows="6"
					cols="33" />

				<h:outputText value="Telefono 1: " />
				<p:inputMask value="#{contribuyente.telefono1}" mask="9999-9999" />


				<h:outputText value="Telefono 2: " />
				<p:inputMask value="#{contribuyente.telefono2}" mask="9999-9999" />

				


				<h:outputText value="Departamento: " />
				<p:inputText value="#{contribuyente.codDep}" />

				<h:outputText value="Municipio: " />
				<p:inputText value="#{contribuyente.codMuni}" />

				<h:outputText value="NIT: " />
				<p:inputMask value="#{contribuyente.numNit}"
					mask="9999-999999-999-9" />

				<h:outputText value="Codigo Giro: " />
				<p:inputText value="#{contribuyente.codGiro}" />


   
			</p:panelGrid>
			 
		</p:panel>
 



	 
    <p:panel id="pnl" header="Registro de Contribuyentes" toggleable="true" closable="true" toggleSpeed="500" closeSpeed="500" widgetVar="panel">  
  
      
  
        <p:growl id="messages" showDetail="true"/>  
  
    <p:contextMenu for="contri" widgetVar="cMenu">     
        <p:menuitem value="Edit Cell" icon="ui-icon-search" onclick="carsTable.showCellEditor();return false;"/>    
        <p:menuitem value="Hide Menu" icon="ui-icon-close" onclick="cMenu.hide()"/>    
    </p:contextMenu>   
  
    <p:dataTable id="contri" var="contri" value="#{contribuyente.contribuyentes}" editable="true" editMode="cell" widgetVar="carsTable" >  
  
          
  
        <!--  p:ajax event="cellEdit" listener="#{tableBean.onCellEdit}" update=":form:messages" /-->  
  
        <p:column headerText="Registro Proveedor" style="width:25%">  
               <p:cellEditor>  
                   <f:facet name="output"><h:outputText value="#{contri.regProv}" /></f:facet>  
                   <f:facet name="input"><p:inputText id="modelInput" value="#{contri.regProv}" style="width:96%"/></f:facet>  
               </p:cellEditor>  
           </p:column>  
  
           <p:column headerText="Correo Electronico" style="width:25%">  
            <p:cellEditor>  
                <f:facet name="output"><h:outputText value="#{contri.correoe}" /></f:facet>  
                <f:facet name="input"><p:inputText value="#{contri.correoe}" style="width:96%" label="Year"/></f:facet>  
            </p:cellEditor>  
        </p:column>
        
        <p:column headerText="Representante Legal" style="width:25%">  
            <p:cellEditor>  
                <f:facet name="output"><h:outputText value="#{contri.nomProv}" /></f:facet>  
                <f:facet name="input"><p:inputText value="#{contri.nomProv}" style="width:96%" label="Year"/></f:facet>  
            </p:cellEditor>  
        </p:column>    
  
   
    </p:dataTable>    
  
        <f:facet name="options">  
            <p:menu>  
                <p:submenu label="Settings">  
                    <p:menuitem value="Toggle" url="#" icon="ui-icon-newwin" onclick="panel.toggle()"/>  
                    <p:menuitem value="Remove" url="#" icon="ui-icon-close" onclick="panel.close()"/>  
                </p:submenu>  
            </p:menu>  
        </f:facet>  
    </p:panel>  


    </p:layoutUnit>  
</p:layout>  
    	</h:form>        
	
</body>
</html>
